<?php
/**
 * autoloader for phpmy framework
 *
 * PHP version 5
 *
 * @category  PHP
 * @package   PHPMY
 * @author    Sven Ruttloff, www.sruttloff.de <service@sruttloff.de>
 * @copyright 2010 Sven Ruttloff, www.sruttloff.de
 * @license   http://www.sruttloff.de/cms/files/licence_en_lgpl.txt LGPL
 * @version   SVN: $Id: yui.spl.autoloader.inc.php 71 2010-06-18 11:18:56Z sruttloff $
 * @link      phpmy
 */

/**
 * PHP5 autoload function for classes ind ERP and phpMy
 *
 * @param string $object class name
 *
 * @return bool
 */
function _phpMyautoload($object)
{
    // extend upper case chars with .
    $object = strtolower(preg_replace('=([A-Z])=', '.\1', $object));
    $phpmyfile = dirname(dirname(__FILE__)) . '/class/' .$object . '.class.php';
    if (!file_exists($phpmyfile)) return false;
    return @include_once $phpmyfile;
}

spl_autoload_register('_phpMyautoload');